package com.di.base.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface StorageMapper {
    @Update("UPDATE storage_tbl SET count = count - #{count} WHERE product_id = #{productId} AND count >= #{count}")
    int decrease(@Param("productId") String productId, @Param("count") int count);


}
